package strtus.form;

import java.lang.reflect.Field;

import javax.activation.FileDataSource;
import javax.servlet.http.HttpServletRequest;

public class FullBean {
	public  FullBean() {

	}
	
	public static ActionForm full(String formpath,HttpServletRequest request){
		
		ActionForm form = null;
		try {
			Class clazz=Class.forName(formpath);
			form=(ActionForm) clazz.newInstance();
			Field[] field_ar =clazz.getDeclaredFields();
			for(Field f:field_ar){
				f.setAccessible(true);
				f.set(form, request.getParameter(f.getName()));
				f.setAccessible(false);
			}
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			System.out.println("严重：Form 装载失败！");
		}
		return form;
		
	}
}
